//
//  FitureCustomPresentNaigationController.swift
//  taurus
//
//  Created by 刘艺 on 2021/10/18.
//  Copyright © 2021 com.fiture. All rights reserved.
//

import UIKit

class FitureCustomPresentNaigationController: UINavigationController {

    init() {
        super.init(navigationBarClass: FitureCustomPresentNavigationBar.self, toolbarClass: nil)
    }

    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
    }

    override init(rootViewController: UIViewController) {
        super.init(navigationBarClass: FitureCustomPresentNavigationBar.self, toolbarClass: nil)
        self.viewControllers = [rootViewController]
    }

    required public init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

class FitureCustomPresentNavigationBar: UINavigationBar {

    override init(frame: CGRect) {
        super.init(frame: frame)
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }

//    override func layoutSubviews() {
//        super.layoutSubviews()
//
//        for view: UIView in self.subviews {
//            if NSStringFromClass(type(of: view)) == "_UINavigationBarContentView" {
//                let bounds: CGRect = self.bounds
//                var frame: CGRect = view.frame
//                frame.origin.y = bounds.origin.y - (FiturePresentContainerViewController.fitureCustomNaigationHeight - 44)/2
//                frame.size.height = bounds.size.height
//                view.frame = frame
//            }
//        }
//    }
}

